﻿#region File Description
//-----------------------------------------------------------------------------
// OptionsMenuScreen.cs
//
// Microsoft XNA Community Game Platform
// Copyright (C) Microsoft Corporation. All rights reserved.
//-----------------------------------------------------------------------------
#endregion

#region Using Statements
using Microsoft.Xna.Framework;
#endregion

namespace TvGame
{
    /// <summary>
    /// The options screen is brought up over the top of the main menu
    /// screen, and gives the user a chance to configure the game
    /// in various hopefully useful ways.
    /// </summary>
    class GameOverScreen : MenuScreen
    {
        #region Fields

        MenuEntry RetryMenuEntry;
        MenuEntry QuitMenuEntry;       

        #endregion

        #region Initialization


        /// <summary>
        /// Constructor.
        /// </summary>
        public GameOverScreen()
            : base("Game Over! \nYour Score: " + GameplayScreen.score)
        {
            // Create our menu entries.
            RetryMenuEntry = new MenuEntry("Retry");
            QuitMenuEntry = new MenuEntry("Quit");
                     
            // Hook up menu event handlers.
            RetryMenuEntry.Selected += RetryMenuEntrySelected;
            QuitMenuEntry.Selected += QuitMenuEntrySelected;
            
            // Add entries to the menu.
            MenuEntries.Add(RetryMenuEntry);
            MenuEntries.Add(QuitMenuEntry);            
        }
       
        #endregion

        #region Handle Input


        /// <summary>
        /// Event handler for when the Ungulate menu entry is selected.
        /// </summary>
        void RetryMenuEntrySelected(object sender, PlayerIndexEventArgs e)
        {
            LoadingScreen.Load(ScreenManager, true, e.PlayerIndex,
                               new GameplayScreen());
        }


        /// <summary>
        /// Event handler for when the Language menu entry is selected.
        /// </summary>
        void QuitMenuEntrySelected(object sender, PlayerIndexEventArgs e)
        {
            LoadingScreen.Load(ScreenManager, true, e.PlayerIndex,
                new BackgroundScreen(),
                new MainMenuScreen());
        }        
        #endregion
    }
}
